package Service;

import java.util.HashMap;
import java.util.Iterator;

public class Massage_Thread {
    private static HashMap<String, Service_Thread> hm = new HashMap();

    public Massage_Thread() {
    }

    public static void Add_Thread(String userId, Service_Thread thread) {
        hm.put(userId, thread);
    }
    public static void remove_Thread(String userId){
        hm.remove(userId);
    }
    public static HashMap<String, Service_Thread> getHm() {
        return hm;
    }
    public static Service_Thread service_thread(String userId) {
        return hm.get(userId);
    }
    public static String getOlineUser(){
        Iterator<String> iterator=hm.keySet().iterator();
        String olineUser="";
        while (iterator.hasNext()) {
            olineUser += iterator.next().toString()+" ";
        }
        return olineUser;
    }
}